

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>API documentation &mdash; hrvanalysis 1.0.0 documentation</title>
  

  
  
  
  

  

  
  
    

  

  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Tutorial - Python examples" href="tutorial.html" />
    <link rel="prev" title="Getting started" href="readme.html" /> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="index.html" class="icon icon-home"> hrvanalysis
          

          
          </a>

          
            
            
              <div class="version">
                1.0
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="readme.html">Getting started</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">API documentation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#module-hrvanalysis.preprocessing">Preprocessing methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-hrvanalysis.extract_features">Features extraction methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-hrvanalysis.plot">Plot methods</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Tutorial - Python examples</a></li>
<li class="toctree-l1"><a class="reference internal" href="unittests.html">Hrv-analysis Unittests¶</a></li>
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="references.html">References</a></li>
<li class="toctree-l1"><a class="reference internal" href="contribute.html">Contribute</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">hrvanalysis</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="index.html">Docs</a> &raquo;</li>
        
      <li>API documentation</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="_sources/hrvanalysis.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="api-documentation">
<h1>API documentation<a class="headerlink" href="#api-documentation" title="Permalink to this headline">¶</a></h1>
<p>Hrv-analysis consists of a single module which contains all relevant functions and algorithms.</p>
<p>Internally these functions are subdivided into 3 different modules :</p>
<ul class="simple">
<li>preprocessing</li>
<li>extract_features</li>
<li>plot</li>
</ul>
<p>You should not need to import those modules directly unless you want access to some internal helper functions.</p>
<div class="section" id="module-hrvanalysis.preprocessing">
<span id="preprocessing-methods"></span><h2>Preprocessing methods<a class="headerlink" href="#module-hrvanalysis.preprocessing" title="Permalink to this headline">¶</a></h2>
<p>This script provides several methods to clean abnormal and ectopic RR-intervals.</p>
<dl class="function">
<dt id="hrvanalysis.preprocessing.remove_outliers">
<code class="descclassname">hrvanalysis.preprocessing.</code><code class="descname">remove_outliers</code><span class="sig-paren">(</span><em>rr_intervals: List[float], verbose: bool = True, low_rri: int = 300, high_rri: int = 2000</em><span class="sig-paren">)</span> &#x2192; list<a class="headerlink" href="#hrvanalysis.preprocessing.remove_outliers" title="Permalink to this definition">¶</a></dt>
<dd><p>Function that replace RR-interval outlier by nan.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>rr_intervals</strong> (<em>list</em>) – raw signal extracted.</li>
<li><strong>low_rri</strong> (<em>int</em>) – lowest RrInterval to be considered plausible.</li>
<li><strong>high_rri</strong> (<em>int</em>) – highest RrInterval to be considered plausible.</li>
<li><strong>verbose</strong> (<em>bool</em>) – Print information about deleted outliers.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>rr_intervals_cleaned</strong> – list of RR-intervals without outliers</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">list</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<table class="docutils footnote" frame="void" id="id1" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[1]</td><td><ol class="first last upperalpha simple" start="15">
<li>Inbar, A. Oten, M. Scheinowitz, A. Rotstein, R. Dlin, R.Casaburi. Normal     cardiopulmonary responses during incremental exercise in 20-70-yr-old men.</li>
</ol>
</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id2" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[2]</td><td><ol class="first last upperalpha simple" start="23">
<li><ol class="first upperalpha" start="3">
<li>Miller, J. P. Wallace, K. E. Eggert. Predicting max HR and the HR-VO2 relationship    for exercise prescription in obesity.</li>
</ol>
</li>
</ol>
</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id3" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[3]</td><td><ol class="first last upperalpha simple" start="8">
<li>Tanaka, K. D. Monahan, D. R. Seals. Age-predictedmaximal heart rate revisited.</li>
</ol>
</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id4" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[4]</td><td><ol class="first last upperalpha simple" start="13">
<li>Gulati, L. J. Shaw, R. A. Thisted, H. R. Black, C. N. B.Merz, M. F. Arnsdorf. Heart     rate response to exercise stress testing in asymptomatic women.</li>
</ol>
</td></tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="hrvanalysis.preprocessing.remove_ectopic_beats">
<code class="descclassname">hrvanalysis.preprocessing.</code><code class="descname">remove_ectopic_beats</code><span class="sig-paren">(</span><em>rr_intervals: List[float], method: str = 'malik', custom_removing_rule: float = 0.2</em><span class="sig-paren">)</span> &#x2192; list<a class="headerlink" href="#hrvanalysis.preprocessing.remove_ectopic_beats" title="Permalink to this definition">¶</a></dt>
<dd><p>RR-intervals differing by more than the removing_rule from the one proceeding it are removed.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>rr_intervals</strong> (<em>list</em>) – list of RR-intervals</li>
<li><strong>method</strong> (<em>str</em>) – method to use to clean outlier. malik, kamath, karlsson, acar or custom.</li>
<li><strong>custom_removing_rule</strong> (<em>int</em>) – Percentage criteria of difference with previous RR-interval at which we consider
that it is abnormal. If method is set to Karlsson, it is the percentage of difference
between the absolute mean of previous and next RR-interval at which  to consider the beat
as abnormal.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><ul class="simple">
<li><strong>nn_intervals</strong> (<em>list</em>) – list of NN Interval</li>
<li><strong>outlier_count</strong> (<em>int</em>) – Count of outlier detected in RR-interval list</li>
</ul>
</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<table class="docutils footnote" frame="void" id="id5" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[5]</td><td>Kamath M.V., Fallen E.L.: Correction of the Heart Rate Variability Signal for Ectopics     and Miss- ing Beats, In: Malik M., Camm A.J.</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id6" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[6]</td><td>Geometric Methods for Heart Rate Variability Assessment - Malik M et al</td></tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="hrvanalysis.preprocessing.interpolate_nan_values">
<code class="descclassname">hrvanalysis.preprocessing.</code><code class="descname">interpolate_nan_values</code><span class="sig-paren">(</span><em>rr_intervals: list</em>, <em>interpolation_method: str = 'linear'</em>, <em>limit=1</em><span class="sig-paren">)</span> &#x2192; list<a class="headerlink" href="#hrvanalysis.preprocessing.interpolate_nan_values" title="Permalink to this definition">¶</a></dt>
<dd><p>Function that interpolate Nan values with linear interpolation</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>rr_intervals</strong> (<em>list</em>) – RrIntervals list.</li>
<li><strong>interpolation_method</strong> (<em>str</em>) – Method used to interpolate Nan values of series.</li>
<li><strong>limit</strong> (<em>int</em>) – TODO</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>interpolated_rr_intervals</strong> – new list with outliers replaced by interpolated values.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">list</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="hrvanalysis.preprocessing.get_nn_intervals">
<code class="descclassname">hrvanalysis.preprocessing.</code><code class="descname">get_nn_intervals</code><span class="sig-paren">(</span><em>rr_intervals: List[float], low_rri: int = 300, high_rri: int = 2000, interpolation_method: str = 'linear', ectopic_beats_removal_method: str = 'kamath', verbose: bool = True</em><span class="sig-paren">)</span> &#x2192; List[float]<a class="headerlink" href="#hrvanalysis.preprocessing.get_nn_intervals" title="Permalink to this definition">¶</a></dt>
<dd><p>Function that computes NN Intervals from RR-intervals.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>rr_intervals</strong> (<em>list</em>) – RrIntervals list.</li>
<li><strong>interpolation_method</strong> (<em>str</em>) – Method used to interpolate Nan values of series.</li>
<li><strong>ectopic_beats_removal_method</strong> (<em>str</em>) – method to use to clean outlier. malik, kamath, karlsson, acar or custom.</li>
<li><strong>low_rri</strong> (<em>int</em>) – lowest RrInterval to be considered plausible.</li>
<li><strong>high_rri</strong> (<em>int</em>) – highest RrInterval to be considered plausible.</li>
<li><strong>verbose</strong> (<em>bool</em>) – Print information about deleted outliers.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>interpolated_nn_intervals</strong> – list of NN Interval interpolated</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">list</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="module-hrvanalysis.extract_features">
<span id="features-extraction-methods"></span><h2>Features extraction methods<a class="headerlink" href="#module-hrvanalysis.extract_features" title="Permalink to this headline">¶</a></h2>
<p>This script provides several methods to extract features from Normal to Normal Intervals
for heart rate variability analysis.</p>
<dl class="function">
<dt id="hrvanalysis.extract_features.get_time_domain_features">
<code class="descclassname">hrvanalysis.extract_features.</code><code class="descname">get_time_domain_features</code><span class="sig-paren">(</span><em>nn_intervals: List[float]</em><span class="sig-paren">)</span> &#x2192; dict<a class="headerlink" href="#hrvanalysis.extract_features.get_time_domain_features" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a dictionary containing time domain features for HRV analysis.
Mostly used on long term recordings (24h) but some studies use some of those features on
short term recordings, from 1 to 5 minutes window.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>nn_intervals</strong> (<em>list</em>) – list of Normal to Normal Interval</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>time_domain_features</strong> – dictionary containing time domain features for HRV analyses. There are details
about each features below.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Here are some details about feature engineering…</p>
<ul class="simple">
<li><strong>mean_nni</strong>: The mean of RR-intervals.</li>
<li><strong>sdnn</strong> : The standard deviation of the time interval between successive normal heart beats     (i.e. the RR-intervals).</li>
<li><strong>sdsd</strong>: The standard deviation of differences between adjacent RR-intervals</li>
<li><strong>rmssd</strong>: The square root of the mean of the sum of the squares of differences between     adjacent NN-intervals. Reflects high frequency (fast or parasympathetic) influences on hrV     (<em>i.e.</em>, those influencing larger changes from one beat to the next).</li>
<li><strong>median_nni</strong>: Median Absolute values of the successive differences between the RR-intervals.</li>
<li><strong>nni_50</strong>: Number of interval differences of successive RR-intervals greater than 50 ms.</li>
<li><strong>pnni_50</strong>: The proportion derived by dividing nni_50 (The number of interval differences     of successive RR-intervals greater than 50 ms) by the total number of RR-intervals.</li>
<li><strong>nni_20</strong>: Number of interval differences of successive RR-intervals greater than 20 ms.</li>
<li><strong>pnni_20</strong>: The proportion derived by dividing nni_20 (The number of interval differences     of successive RR-intervals greater than 20 ms) by the total number of RR-intervals.</li>
<li><strong>range_nni</strong>: difference between the maximum and minimum nn_interval.</li>
<li><strong>cvsd</strong>: Coefficient of variation of successive differences equal to the rmssd divided by     mean_nni.</li>
<li><strong>cvnni</strong>: Coefficient of variation equal to the ratio of sdnn divided by mean_nni.</li>
<li><strong>mean_hr</strong>: The mean Heart Rate.</li>
<li><strong>max_hr</strong>: Max heart rate.</li>
<li><strong>min_hr</strong>: Min heart rate.</li>
<li><strong>std_hr</strong>: Standard deviation of heart rate.</li>
</ul>
<p class="rubric">References</p>
<table class="docutils footnote" frame="void" id="id7" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[1]</td><td>Heart rate variability - Standards of measurement, physiological interpretation, and     clinical use, Task Force of The European Society of Cardiology and The North American Society     of Pacing and Electrophysiology, 1996</td></tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="hrvanalysis.extract_features.get_frequency_domain_features">
<code class="descclassname">hrvanalysis.extract_features.</code><code class="descname">get_frequency_domain_features</code><span class="sig-paren">(</span><em>nn_intervals: List[float], method: str = 'welch', sampling_frequency: int = 4, interpolation_method: str = 'linear', vlf_band: collections.namedtuple = Vlf_band(low=0.003, high=0.04), lf_band: collections.namedtuple = Lf_band(low=0.04, high=0.15), hf_band: collections.namedtuple = Hf_band(low=0.15, high=0.4)</em><span class="sig-paren">)</span> &#x2192; dict<a class="headerlink" href="#hrvanalysis.extract_features.get_frequency_domain_features" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a dictionary containing frequency domain features for HRV analyses.
To our knowledge, you might use this function on short term recordings, from 2 to 5 minutes      window.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>nn_intervals</strong> (<em>list</em>) – list of Normal to Normal Interval</li>
<li><strong>method</strong> (<em>str</em>) – Method used to calculate the psd. Choice are Welch’s FFT or Lomb method.</li>
<li><strong>sampling_frequency</strong> (<em>int</em>) – Frequency at which the signal is sampled. Common value range from 1 Hz to 10 Hz,
by default set to 4 Hz. No need to specify if Lomb method is used.</li>
<li><strong>interpolation_method</strong> (<em>str</em>) – kind of interpolation as a string, by default “linear”. No need to specify if Lomb
method is used.</li>
<li><strong>vlf_band</strong> (<em>tuple</em>) – Very low frequency bands for features extraction from power spectral density.</li>
<li><strong>lf_band</strong> (<em>tuple</em>) – Low frequency bands for features extraction from power spectral density.</li>
<li><strong>hf_band</strong> (<em>tuple</em>) – High frequency bands for features extraction from power spectral density.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>frequency_domain_features</strong> – Dictionary containing frequency domain features for HRV analyses. There are details
about each features below.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">dict</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Details about feature engineering…</p>
<ul class="simple">
<li><strong>total_power</strong> : Total power density spectral</li>
<li><strong>vlf</strong> : variance ( = power ) in HRV in the Very low Frequency (.003 to .04 Hz by default).     Reflect an intrinsic rhythm produced by the heart which is modulated primarily by sympathetic     activity.</li>
<li><strong>lf</strong> : variance ( = power ) in HRV in the low Frequency (.04 to .15 Hz). Reflects a     mixture of sympathetic and parasympathetic activity, but in long-term recordings, it reflects     sympathetic activity and can be reduced by the beta-adrenergic antagonist propanolol.</li>
<li><strong>hf</strong>: variance ( = power ) in HRV in the High Frequency (.15 to .40 Hz by default).     Reflects fast changes in beat-to-beat variability due to parasympathetic (vagal) activity.     Sometimes called the respiratory band because it corresponds to HRV changes related to the     respiratory cycle and can be increased by slow, deep breathing (about 6 or 7 breaths per     minute) and decreased by anticholinergic drugs or vagal blockade.</li>
<li><strong>lf_hf_ratio</strong> : lf/hf ratio is sometimes used by some investigators as a quantitative     mirror of the sympatho/vagal balance.</li>
<li><strong>lfnu</strong> : normalized lf power.</li>
<li><strong>hfnu</strong> : normalized hf power.</li>
</ul>
<p class="rubric">References</p>
<table class="docutils footnote" frame="void" id="id8" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[1]</td><td>Heart rate variability - Standards of measurement, physiological interpretation, and     clinical use, Task Force of The European Society of Cardiology and The North American Society     of Pacing and Electrophysiology, 1996</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id9" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[2]</td><td>Signal Processing Methods for Heart Rate Variability - Gari D. Clifford, 2002</td></tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="hrvanalysis.extract_features.get_geometrical_features">
<code class="descclassname">hrvanalysis.extract_features.</code><code class="descname">get_geometrical_features</code><span class="sig-paren">(</span><em>nn_intervals: List[float]</em><span class="sig-paren">)</span> &#x2192; dict<a class="headerlink" href="#hrvanalysis.extract_features.get_geometrical_features" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a dictionary containing geometrical time domain features for HRV analyses.
Known practise is to use this function on recordings from 20 minutes to 24 Hours window.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>nn_intervals</strong> (<em>list</em>) – list of Normal to Normal Interval.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>geometrical_features</strong> – Dictionary containing geometrical time domain features for HRV analyses.
There are details about each features below.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Details about feature engineering…</p>
<ul class="simple">
<li><strong>triangular_index</strong>: The HRV triangular index measurement is the integral of the density     distribution (= the number of all NN-intervals) divided by the maximum of the density     distribution.</li>
<li><strong>tinn</strong>: The triangular interpolation of NN-interval histogram (TINN) is the baseline width      of the distribution measured as a base of a triangle, approximating the NN-interval      distribution</li>
</ul>
<p class="rubric">References</p>
<table class="docutils footnote" frame="void" id="id10" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[1]</td><td>Heart rate variability - Standards of measurement, physiological interpretation, and     clinical use, Task Force of The European Society of Cardiology and The North American Society     of Pacing and Electrophysiology, 1996</td></tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="hrvanalysis.extract_features.get_poincare_plot_features">
<code class="descclassname">hrvanalysis.extract_features.</code><code class="descname">get_poincare_plot_features</code><span class="sig-paren">(</span><em>nn_intervals: List[float]</em><span class="sig-paren">)</span> &#x2192; dict<a class="headerlink" href="#hrvanalysis.extract_features.get_poincare_plot_features" title="Permalink to this definition">¶</a></dt>
<dd><p>Function returning a dictionary containing 3 features from non linear domain
for HRV analyses.
Known practise is to use this function on short term recordings, from 5 minutes window.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>nn_intervals</strong> (<em>list</em>) – Normal to Normal Interval</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>poincare_plot_features</strong> – Dictionary containing non linear domain features for hrV analyses. There
are details about each features are given below.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<ul class="simple">
<li><strong>sd1</strong> : The standard deviation of projection of the Poincaré plot on the line     perpendicular to the line of identity.</li>
<li><strong>sd2</strong> : SD2 is defined as the standard deviation of the projection of the Poincaré     plot on the line of identity (y=x).</li>
<li><strong>ratio_sd2_sd1</strong> : Ratio between SD2 and SD1.</li>
</ul>
<p class="rubric">References</p>
<table class="docutils footnote" frame="void" id="id11" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[4]</td><td>Pre-ictal heart rate variability assessment of epileptic seizures by means of linear     and non- linear analyses, Soroor Behbahani, Nader Jafarnia Dabanloo et al - 2013</td></tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="hrvanalysis.extract_features.get_csi_cvi_features">
<code class="descclassname">hrvanalysis.extract_features.</code><code class="descname">get_csi_cvi_features</code><span class="sig-paren">(</span><em>nn_intervals: List[float]</em><span class="sig-paren">)</span> &#x2192; dict<a class="headerlink" href="#hrvanalysis.extract_features.get_csi_cvi_features" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a dictionary containing 3 features from non linear domain for HRV analyses.
Known practise is to use this function on short term recordings, on 30 , 50, 100 RR-intervals (or
seconds) window.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>nn_intervals</strong> (<em>list</em>) – Normal to Normal Intervals.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>csi_cvi_features</strong> – Dictionary containing non linear domain features for hrV analyses. There are  details about
each features are given below.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<ul class="simple">
<li><strong>csi</strong> : Cardiac Sympathetic Index.</li>
<li><strong>cvi</strong> : Cadiac Vagal Index.</li>
<li><strong>Modified_csi</strong> : Modified CSI is an alternative measure in research of seizure detection.</li>
</ul>
<p class="rubric">References</p>
<table class="docutils footnote" frame="void" id="id12" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[3]</td><td>Using Lorenz plot and Cardiac Sympathetic Index of heart rate variability for detecting     seizures for patients with epilepsy, Jesper Jeppesen et al, 2014</td></tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="hrvanalysis.extract_features.get_sampen">
<code class="descclassname">hrvanalysis.extract_features.</code><code class="descname">get_sampen</code><span class="sig-paren">(</span><em>nn_intervals: List[float]</em><span class="sig-paren">)</span> &#x2192; dict<a class="headerlink" href="#hrvanalysis.extract_features.get_sampen" title="Permalink to this definition">¶</a></dt>
<dd><p>Function computing the sample entropy of the given data.
Must use this function on short term recordings, from 1 minute window.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>nn_intervals</strong> (<em>list</em>) – Normal to Normal Interval</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>sampen</strong> – The sample entropy of the data</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">float</td>
</tr>
</tbody>
</table>
<p class="rubric">References</p>
<table class="docutils footnote" frame="void" id="id13" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[5]</td><td>Physiological time-series analysis using approximate entropy and sample entropy,     JOSHUA S. RICHMAN1, J. RANDALL MOORMAN - 2000</td></tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="module-hrvanalysis.plot">
<span id="plot-methods"></span><h2>Plot methods<a class="headerlink" href="#module-hrvanalysis.plot" title="Permalink to this headline">¶</a></h2>
<p>This script provides several methods to plot RR / NN-intervals.</p>
<dl class="attribute">
<dt id="hrvanalysis.plot.HfBand">
<code class="descclassname">hrvanalysis.plot.</code><code class="descname">HfBand</code><a class="headerlink" href="#hrvanalysis.plot.HfBand" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <code class="xref py py-class docutils literal notranslate"><span class="pre">hrvanalysis.plot.Hf_band</span></code></p>
</dd></dl>

<dl class="attribute">
<dt id="hrvanalysis.plot.LfBand">
<code class="descclassname">hrvanalysis.plot.</code><code class="descname">LfBand</code><a class="headerlink" href="#hrvanalysis.plot.LfBand" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <code class="xref py py-class docutils literal notranslate"><span class="pre">hrvanalysis.plot.Lf_band</span></code></p>
</dd></dl>

<dl class="attribute">
<dt id="hrvanalysis.plot.VlfBand">
<code class="descclassname">hrvanalysis.plot.</code><code class="descname">VlfBand</code><a class="headerlink" href="#hrvanalysis.plot.VlfBand" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <code class="xref py py-class docutils literal notranslate"><span class="pre">hrvanalysis.plot.Vlf_band</span></code></p>
</dd></dl>

<dl class="function">
<dt id="hrvanalysis.plot.plot_distrib">
<code class="descclassname">hrvanalysis.plot.</code><code class="descname">plot_distrib</code><span class="sig-paren">(</span><em>nn_intervals: List[float], bin_length: int = 8</em><span class="sig-paren">)</span><a class="headerlink" href="#hrvanalysis.plot.plot_distrib" title="Permalink to this definition">¶</a></dt>
<dd><p>Function plotting histogram distribution of the NN Intervals. Useful for geometrical features.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>nn_intervals</strong> (<em>list</em>) – list of Normal to Normal Interval.</li>
<li><strong>bin_length</strong> (<em>int</em>) – size of the bin for histogram in ms, by default = 8.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="hrvanalysis.plot.plot_poincare">
<code class="descclassname">hrvanalysis.plot.</code><code class="descname">plot_poincare</code><span class="sig-paren">(</span><em>nn_intervals: List[float], plot_sd_features: bool = True</em><span class="sig-paren">)</span><a class="headerlink" href="#hrvanalysis.plot.plot_poincare" title="Permalink to this definition">¶</a></dt>
<dd><p>Pointcare / Lorentz Plot of the NN Intervals</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>nn_intervals</strong> (<em>list</em>) – list of NN intervals</li>
<li><strong>plot_sd_features</strong> (<em>bool</em>) – Option to show or not SD1 and SD2 features on plot. By default, set to True.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>The transverse axis (T) reflects beat-to-beat variation
the longitudinal axis (L) reflects the overall fluctuation</p>
</dd></dl>

<dl class="function">
<dt id="hrvanalysis.plot.plot_psd">
<code class="descclassname">hrvanalysis.plot.</code><code class="descname">plot_psd</code><span class="sig-paren">(</span><em>nn_intervals: List[float], method: str = 'welch', sampling_frequency: int = 7, interpolation_method: str = 'linear', vlf_band: collections.namedtuple = Vlf_band(low=0.003, high=0.04), lf_band: collections.namedtuple = Lf_band(low=0.04, high=0.15), hf_band: collections.namedtuple = Hf_band(low=0.15, high=0.4)</em><span class="sig-paren">)</span><a class="headerlink" href="#hrvanalysis.plot.plot_psd" title="Permalink to this definition">¶</a></dt>
<dd><p>Function plotting the power spectral density of the NN Intervals.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>nn_intervals</strong> (<em>list</em>) – list of Normal to Normal Interval.</li>
<li><strong>method</strong> (<em>str</em>) – Method used to calculate the psd. Choice are Welch’s FFT (welch) or Lomb method (lomb).</li>
<li><strong>sampling_frequency</strong> (<em>int</em>) – frequence at which the signal is sampled. Common value range from 1 Hz to 10 Hz, by default
set to 7 Hz. No need to specify if Lomb method is used.</li>
<li><strong>interpolation_method</strong> (<em>str</em>) – kind of interpolation as a string, by default “linear”. No need to specify if lomb method is
used.</li>
<li><strong>vlf_band</strong> (<em>tuple</em>) – Very low frequency bands for features extraction from power spectral density.</li>
<li><strong>lf_band</strong> (<em>tuple</em>) – Low frequency bands for features extraction from power spectral density.</li>
<li><strong>hf_band</strong> (<em>tuple</em>) – High frequency bands for features extraction from power spectral density.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="hrvanalysis.plot.plot_timeseries">
<code class="descclassname">hrvanalysis.plot.</code><code class="descname">plot_timeseries</code><span class="sig-paren">(</span><em>nn_intervals: List[float], normalize: bool = True, autoscale: bool = True, y_min: float = None, y_max: float = None</em><span class="sig-paren">)</span><a class="headerlink" href="#hrvanalysis.plot.plot_timeseries" title="Permalink to this definition">¶</a></dt>
<dd><p>Function plotting the NN-intervals time series.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>nn_intervals</strong> (<em>list</em>) – list of Normal to Normal Interval.</li>
<li><strong>normalize</strong> (<em>bool</em>) – Set to True to plot X axis as a cumulative sum of Time.
Set to False to plot X axis using x as index array 0, 1, …, N-1.</li>
<li><strong>autoscale</strong> (<em>bool</em>) – Option to normalize the x-axis as a time series for comparison. Set to True by default.</li>
<li><strong>y_min</strong> (<em>float</em>) – Custom min value might be set for y axis.</li>
<li><strong>y_max</strong> (<em>float</em>) – Custom max value might be set for y axis.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<span class="target" id="module-hrvanalysis"></span><p>This script allow user to import directly the most useful functions.</p>
</div>
</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="tutorial.html" class="btn btn-neutral float-right" title="Tutorial - Python examples" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="readme.html" class="btn btn-neutral" title="Getting started" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2018, Robin Champseix.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'1.0.0',
            LANGUAGE:'None',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true,
            SOURCELINK_SUFFIX: '.txt'
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

  

  <script type="text/javascript" src="_static/js/theme.js"></script>

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>